<template>
  <div>
    <el-row>
      <el-col
        v-for="(item, index) in Menu.menuList"
        :key="index"
        :span="24 / Menu.menuList.length"
        md="24"
        ><div class="grid-content ep-bg-purple">
          <router-link tag="li" :to="'/main/' + item.path">{{
            item.msg
          }}</router-link>
        </div></el-col
      >
    </el-row>
  </div>
  <router-view></router-view>
  <!-- <router-view v-slot="{ Component }">
    <keep-alive>
      <component :is="Component" />
    </keep-alive>
  </router-view> -->
</template>

<script setup lang="ts">
import { MenuStore } from "@/stores";
import { onMounted } from "vue";
import { useRouter } from "vue-router";
const Menu = MenuStore();
onMounted(() => {
  useRouter().push({ path: "/main/" + Menu.menuList[0].path });
});
</script>
